<<<<<<< .mine
function PiLevel(type){
    this.name = "levelPi"
    this.path = this.picturePath = Game.picturesPath + "levels/"+this.name + "/";
    Sprite.apply(this);
    Level.apply(this);
    this.type = type;
    this.manual = new Manual (this.path);
    this.requiredTime = 30;
    this.kruznice = new Array(4);

   // methods
    this.isSolved = isSolved;
    this.init = init;

    function isSolved(){
        var result = true;
        for (var i=0; i<this.kruznice.length; i++) {
            result = result && this.kruznice[i].isOK();
        }
        if (result){
            this.timer.TimerStop();
            this.levelSolved();
        }
        return result;
    }
    
        function init (){
        this.kruznice[0] = new JednotkovaKruznica((0 % 2) * 220 + 250,Math.floor(0 / 2) * 220 + 120,    120    ,Math.floor(Math.random()*360));
        this.addChild(this.kruznice[0]);
        this.kruznice[1] = new JednotkovaKruznica((1 % 2) * 220 + 250,Math.floor(1 / 2) * 220 + 120,    285    ,Math.floor(Math.random()*360));
        this.addChild(this.kruznice[1]);
        this.kruznice[2] = new JednotkovaKruznica((2 % 2) * 220 + 250,Math.floor(2 / 2) * 220 + 120,    45    ,Math.floor(Math.random()*360));
        this.addChild(this.kruznice[2]);
        this.kruznice[3] = new JednotkovaKruznica((3 % 2) * 220 + 250,Math.floor(3 / 2) * 220 + 120,    180    ,Math.floor(Math.random()*360));
        this.addChild(this.kruznice[3]);
        
        this.addChild (this.manual);            
    }             
}
            
            
PiLevel.prototype = new Sprite();
PiLevel.tFormat   = new TextFormat(font, 30, black);
PiLevel.tFormat.align = TextFormatAlign.CENTER;=======
function PiLevel(){
    Sprite.apply(this);
    Level.apply(this);
    //    this.mouseChildren = false;
                
    var kruznice = new Array(4);
    //for (var i=0; i<kruznice.length; i++) {
    //	kruznice[i] = new JednotkovaKruznica((i % 2) * 220 + 250,Math.floor(i / 2) * 220 + 120,0,Math.floor(Math.random()*180));
    //	this.addChild(kruznice[i]);
    //}
                
                
    kruznice[0] = new JednotkovaKruznica((0 % 2) * 220 + 250,Math.floor(0 / 2) * 220 + 120,    120    ,Math.floor(Math.random()*360));
    this.addChild(kruznice[0]);
    kruznice[1] = new JednotkovaKruznica((1 % 2) * 220 + 250,Math.floor(1 / 2) * 220 + 120,    285    ,Math.floor(Math.random()*360));
    this.addChild(kruznice[1]);
    kruznice[2] = new JednotkovaKruznica((2 % 2) * 220 + 250,Math.floor(2 / 2) * 220 + 120,    45    ,Math.floor(Math.random()*360));
    this.addChild(kruznice[2]);
    kruznice[3] = new JednotkovaKruznica((3 % 2) * 220 + 250,Math.floor(3 / 2) * 220 + 120,    180    ,Math.floor(Math.random()*360));
    this.addChild(kruznice[3]);
                
    this.isSolved = isSolved;
    function isSolved(){
        var result = true;
        for (var i=0; i<kruznice.length; i++) {
            result = result && kruznice[i].isOK();
        }
        return result;
    }
    this.click = click;  
    this.addEventListener(MouseEvent.CLICK,this.click);
             
                
    function click(e){	
        if(isSolved()){
            e.target.parent.levelSolved();
            //alert("solved!");
        }else{
        //alert("not solved!");
        }
    }
                
               	  
}
            
            
PiLevel.prototype = new Sprite();
PiLevel.tFormat   = new TextFormat(font, 30, black);
PiLevel.tFormat.align = TextFormatAlign.CENTER;>>>>>>> .r36
